package com.mxpio.erp.common.equipment.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.jpa.policy.impl.UUIDPolicy;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import com.mxpioframework.security.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_EQUIPMENT_PROJECT_EXECUTION_PROGRESS")
@Schema(description="执行进度")
public class ProjectExecutionProgress extends BaseEntity {

    private static final long serialVersionUID=1L;

    @Id
    @Generator(policy = UUIDPolicy.class)
    @Column(name = "ID_", updatable = false)
    @Schema(description = "主键")
    private String id;

    @Column(name = "PRO_CODE_")
    @Schema(description = "项目编码")
    private String proCode;

    @Column(name = "ITEM_PERSON_ID_")
    @Schema(description = "人员")
    @Dict(dicCode = "username", dicEntity = User.class, dicText = "nickname")
    private String itemPersonId;

    @Column(name = "ITEM_TIME_")
    @Schema(description = "时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date itemTime;

    @Column(name = "ITEM_STATE_")
    @Schema(description = "状态")
    @Dict(dicCode = "MB_ERP_EQUIPMENT_CALIBRATION_STATUS")
    private String itemState = "30";

    @Column(name = "ITEM_SPEED_")
    @Schema(description = "进度")
    private Integer itemSpeed = 10;

    @Column(name = "ITEM_CONTENT_",columnDefinition = "TEXT")
    @Schema(description = "内容")
    private String itemContent;

    @Column(name = "FILE_")
    @Schema(description = "附件信息")
    private String file;
}
